#!/usr/bin/env bash
# BANNERSTART
# - Copyright 2006-2008, Galois, Inc.
# - This software is distributed under a standard, three-clause BSD license.
# - Please see the file LICENSE, distributed with this software, for specific
# - terms and conditions.
# Author: Adam Wick <awick@galois.com>
# BANNEREND

prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
libdir=@libdir@/HaLVM-@PACKAGE_VERSION@

if [[ "$1" == "--halvm-version" ]]
  then echo "@PACKAGE_VERSION@"; exit;
fi

GHCBIN="${bindir}/@target_prefix@ghc"
LINKSCRIPTOPT="-pgml ${libdir}/ldkernel -optl -static -rtsopts"
LIBDIROPT="-L${libdir}"

exec $GHCBIN $LIBDIROPT ${LINKSCRIPTOPT} ${1+"$@"}
